package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateBusinessChargeDTO;
import com.itlong.cloud.POJO.DTO.operate.OperateProductModelManageGetDTO;
import com.itlong.cloud.POJO.VO.MessageVO;
import com.itlong.cloud.POJO.VO.operate.OperateBusinessOperationLogVO;
import com.itlong.cloud.POJO.VO.operate.OperateProductCodeGetVO;
import com.itlong.cloud.POJO.VO.operate.OperateProductModelManageGetVO;
import com.itlong.cloud.operate.service.IOperateProductModelManageService;
import com.itlong.cloud.paymenthub.IOperateProductModelManageServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      运营-产品型号管理暴露接口实现类
 * </desc>
 *
 * @createDate 2020/11/27
 */
@RestController
public class OperateProductModelManageServiceResource implements IOperateProductModelManageServiceClient {

    @Autowired
    private IOperateProductModelManageService iOperateProductModelManageService;

    /**
     * <desc>
     *      获取业务日志列表
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2020/11/27
     */
    @Override
    @PostMapping(path = "/operate/productModelManage/getLogPage")
    public Page<OperateBusinessOperationLogVO> getLogPage(@RequestBody OperateBusinessChargeDTO operateBusinessChargeDTO) throws Exception {
        return iOperateProductModelManageService.getLogPage(operateBusinessChargeDTO);
    }


    /**
     * <desc>
     *      分页获取任务书产品型号信息
     * </desc>
     *
     * @param operateProductModelManageGetDTO 获取任务书产品型号信息DTO
     * @return 分页任务书产品型号信息
     * @author pengwei
     * @createDate 2020/11/30
     */
    @PostMapping(path = "/operate/productModelManage/getPage")
    public MessageVO    getPage(@RequestBody OperateProductModelManageGetDTO operateProductModelManageGetDTO) throws Exception{
        return iOperateProductModelManageService.getPage(operateProductModelManageGetDTO);
    }

    /**
     * <desc>
     *      获取任务书产品型号详情
     * </desc>
     *
     * @param operateProductModelManageGetDTO 获取任务书产品型号详情DTO
     * @return 任务书产品型号详情
     * @author pengwei
     * @createDate 2020/11/30
     */
    @PostMapping(path = "/operate/productModelManage/getOne")
    public  OperateProductModelManageGetVO   getOne(@RequestBody OperateProductModelManageGetDTO operateProductModelManageGetDTO) throws Exception{
        return iOperateProductModelManageService.getOne(operateProductModelManageGetDTO);
    }

    /**
     * <desc>
     *      任务书产品型号信息删除
     * </desc>
     *
     * @param dto 任务书产品型号dto
     * @return 任务书产品型号删除
     * @author pengwei
     * @createDate 2020/12/01
     */
    @PostMapping(path = "/operate/productModelManage/delete")
    public Integer   delete(@RequestBody  OperateProductModelManageGetDTO  dto)throws Exception{
        return  iOperateProductModelManageService.delete(dto);
    }

    /**
     * <desc>
     *      添加或者更新产品型号
     * </desc>
     *
     * @param dto 产品型号dto
     * @return
     * @author pengwei
     * @createDate 2020/12/01
     */
    @PostMapping(path = "/operate/productModelManage/saveOrUpdate")
    public MessageVO saveOrUpdate(@RequestBody OperateProductModelManageGetDTO dto) throws Exception{
        return  iOperateProductModelManageService.saveOrUpdate(dto);
    }


    /**
     * <desc>
     *      获取产品型号相关产品编码列表
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author pengwei
     * @createDate 2020/12/02
     */
    @PostMapping(path = "/operate/productModelManage/getRelatedProcCodePage")
    public  Page<OperateProductCodeGetVO> getRelatedProcCodePage(@RequestBody OperateProductModelManageGetDTO dto) throws Exception{
        return  iOperateProductModelManageService.getRelatedProcCodePage(dto);
    }

    /**
     * <desc>
     *      获取产品编码列表
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author pengwei
     * @createDate 2020/12/02
     */
    @PostMapping(path = "/operate/productModelManage/proCodeSearch")
    public  Page<OperateProductCodeGetVO> getProcCodePage(@RequestBody OperateProductModelManageGetDTO dto) throws Exception{
        return iOperateProductModelManageService.getProcCodePage(dto);
    }
}
